#!/bin/bash
if [ -n "$2" ]
then
	do_date=$2
else
	do_date= $(date -d yesterday +%F)
fi

echo 当前要操作的日期是$do_date


dwd_interaction_favor_add_inc="

"
dwd_tool_coupon_used_inc="

"
dwd_trade_cart_add_inc="

"
dwd_trade_cart_full="

"
dwd_trade_order_detail_inc="

"
dwd_trade_pay_detail_suc_inc="

"
dwd_trade_trade_flow_acc="

"
dwd_traffic_page_view_inc="

"
dwd_user_login_inc="

"
dwd_user_register_inc="

"


case $1 in
    "dwd_trade_cart_add_inc" )
        hive --database gmall -e   "$dwd_trade_cart_add_inc"
    ;;
    "dwd_trade_order_detail_inc" )
        hive --database gmall -e   "$dwd_trade_order_detail_inc"
    ;;
    "dwd_trade_pay_detail_suc_inc" )
        hive --database gmall -e   "$dwd_trade_pay_detail_suc_inc"
    ;;
    "dwd_trade_cart_full" )
        hive --database gmall -e   "$dwd_trade_cart_full"
    ;;   
    "dwd_trade_trade_flow_acc" )
        hive --database gmall -e   "$dwd_trade_trade_flow_acc"
    ;;  
    "dwd_tool_coupon_used_inc" )
        hive --database gmall -e   "$dwd_tool_coupon_used_inc"
    ;;
    "dwd_interaction_favor_add_inc" )
        hive --database gmall -e   "$dwd_interaction_favor_add_inc"
    ;;
    "dwd_traffic_page_view_inc" )
        hive --database gmall -e   "$dwd_traffic_page_view_inc"
    ;;
    "dwd_user_register_inc" )
        hive --database gmall -e   "$dwd_user_register_inc"
    ;;   
    "dwd_user_login_inc" )
        hive --database gmall -e   "$dwd_user_login_inc"
    ;; 
    "all" )
        hive --database gmall -e   "$dwd_trade_cart_add_inc$dwd_trade_order_detail_inc$dwd_trade_pay_detail_suc_inc$dwd_trade_cart_full$dwd_trade_trade_flow_acc$dwd_tool_coupon_used_inc$dwd_interaction_favor_add_inc$dwd_traffic_page_view_inc$dwd_user_register_inc$dwd_user_login_inc"
    ;;
esac
